class LoginController < ApplicationController
  before_filter :authorize, :except => :login
  def login
     session[:user_id] = nil
     if request.post?
       user = User.authenticate(params[:name], params[:password])
       if user
         session[:user_id] = user.id
         redirect_to("/")
       else
         flash[:notice] = "Invalid user/password combination"
       end
     end
        
  end
  def logoutstatus 
    
  end
  def logout
      session[:user_id] = nil
  end
end
